define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'ip/index',
        add_url: 'ip/add',
        edit_url: 'ip/edit',
        delete_url: 'ip/delete',
        export_url: 'ip/export',
        modify_url: 'ip/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'Country', title: '国家'},
                    {field: 'Province', title: '省份'},
                    {field: 'City', title: '城市'},
                    {field: 'Isp', title: '运营商'},
                    {field: 'ip', title: 'ip地址'},
                    {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
                    {field: 'remark', title: '备注说明'},
                    {field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});